home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Tools / Mac / MacMake.rul < prev    next >
Encoding:
Text File  |  1995-11-08  |  14.0 KB  |  409 lines  |  [TEXT/MPS ]

  1. #####################################################################################
  2. # Application
  3. #####################################################################################
  4.  
  5. "{_FWTargetObjectsDir}{__AppName}" ƒƒ ∂
  6.             {__FrameworkObjects} ∂
  7.             {__AppObjects}
  8.     {_FWEcho} {_FWEchoOptions} "Linking:     {__AppName}"
  9.     {_FWLink} ∂
  10.         {_FWLinkOptions} ∂
  11.         {__InitLibs} ∂
  12.         {__FrameworkObjects} ∂
  13.         {__OtherObjects} ∂
  14.         {__AppObjects} ∂
  15.         {__SystemObjects} ∂
  16.         -o "{_FWTargetObjectsDir}{__AppName}"
  17.     {_FWEcho} {_FWEchoOptions} "Creator&Bundle:    {__AppName}"
  18.     CreatorAndBundle ∂
  19.         {_FWCreatorAndBundleOptions} ∂
  20.         "{_FWTargetObjectsDir}{__AppName}"
  21.  
  22. "{_FWTargetObjectsDir}{__AppName}" ƒƒ ∂
  23.             "{_FWTargetObjectsDir}BRResourcesCache.rsrc"
  24.     {_FWEcho} {_FWEchoOptions} "Merging resources for:    {__AppName}"
  25.     echo "include ∂"{_FWTargetObjectsDir}BRResourcesCache.rsrc∂";" ∂
  26.         | {_FWRC} -a -o "{_FWTargetObjectsDir}{__AppName}"
  27.         
  28. "{_FWTargetObjectsDir}BRResourcesCache.rsrc" ƒ ∂
  29.             {__FrameworkResources} ∂
  30.             {__AppResources}
  31.     {_FWEcho} {_FWEchoOptions} "Consolidating: {__AppName}"
  32.     for __resourceFile__ in {__FrameworkResources}
  33.             echo "include ∂"{__resourceFile__}∂";" ∂
  34.                 | {_FWRC} -a -o "{_FWTargetObjectsDir}BRResourcesCache.rsrc"    
  35.     end
  36.     {_FWEcho} {_FWEchoOptions} "Consolidating: {__AppName}"
  37.     for __resourceFile__ in {__AppResources}
  38.         echo "include ∂"{__resourceFile__}∂";" ∂
  39.             | {_FWRC} -a -o "{_FWTargetObjectsDir}BRResourcesCache.rsrc"    
  40.     end
  41.  
  42. "{_FWTargetObjectsDir}{__AppName}" ƒƒ 
  43.     {_FWEcho} {_FWEchoOptions} " ∂"{_FWTargetObjectsDir}{__AppName}∂"  # <- Execute to run your application"
  44.  
  45.  
  46. #####################################################################################
  47. # MPW Tool
  48. #####################################################################################
  49. "{_FWTargetObjectsDir}{__ToolName}" ƒƒ ∂
  50.             {__ToolObjects}
  51.     {_FWEcho} {_FWEchoOptions} "Linking:     {__ToolName}"
  52.     {_FWLink} ∂
  53.         -t 'MPST' -c 'MPS ' ∂
  54.         {_FWLinkOptions} ∂
  55.         {__InitLibs} ∂
  56.         {__ToolObjects} ∂
  57.         {__SystemObjects} ∂
  58.         {__ToolLinkOptions} ∂
  59.         {__SystemLibEquates} ∂
  60.         -o "{_FWTargetObjectsDir}{__ToolName}"
  61.     {_FWEcho} {_FWEchoOptions} " ∂"{_FWTargetObjectsDir}{__ToolName}∂"  # <- Execute to run your application"
  62.  
  63. "{_FWTargetObjectsDir}{__ToolName}" ƒƒ ∂
  64.             {__ToolResources}
  65.     {_FWEcho} {_FWEchoOptions} "Merging Tool resources for:    {__ToolName}"
  66.     for __resourceFile__ in {__ToolResources}
  67.         echo "include ∂"{__resourceFile__}∂";" ∂
  68.             | {_FWRC} -a -o "{_FWTargetObjectsDir}{__ToolName}"    
  69.     end
  70.  
  71. "{_FWTargetObjectsDir}{__ToolName}" ƒƒ 
  72.     {_FWEcho} {_FWEchoOptions} " ∂"{_FWTargetObjectsDir}{__ToolName}∂"  # <- Execute to run your application"
  73.  
  74.  
  75. #####################################################################################
  76. # Dummy target just in case some variables are empty
  77. #####################################################################################
  78.  
  79. SafeTarget = "{FWToolsDir}MacMake.rul"
  80.  
  81. #####################################################################################
  82. # Framework
  83. #####################################################################################
  84.  
  85. #####################################################################################
  86. # CFM Static Library
  87. # A static library target is the same as the IDE target (SOM and resources)
  88. # plus the code target (.o)
  89. #
  90. # The static target is <module>.LIB (abstract)
  91. #
  92. # All object files in __ComponentObjects are libbed into <module>.o in the
  93. # objects folder. It you want it in the Lib folder see the .bmk for the
  94. # OSLayerLib.
  95. #
  96. # All som and resource files are built as described below for the .IDE target.
  97. #####################################################################################
  98.  
  99. "{_FWTargetObjectsDir}{__ComponentName}.LIB" ƒ ∂
  100.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  101.             "{_FWTargetObjectsDir}{__ComponentName}.o" ∂
  102.             {__OtherComponentDependencies}
  103.  
  104. "{_FWTargetObjectsDir}{__ComponentName}.o" ƒ ∂
  105.         {__ComponentObjects} {SafeTarget}
  106.     {_FWEcho} {_FWEchoOptions} "Libbing:          {__ComponentName}.o"
  107.     {_FWLib} ∂
  108.         {__StaticLibraryLinkOptions} ∂
  109.         {__ComponentObjects} ∂
  110.         -o {_FWTargetObjectsDir}"{__ComponentName}.o"
  111.  
  112. #####################################################################################
  113. # Resources build Target
  114. #
  115. # This is an abstract target for building just resources.
  116. #
  117. # The IDE target is <module>.RSED (abstract)
  118. #
  119. # All resource files in __ComponentResources are built and consolidated into
  120. # <module>.IDE.rsrc in the objects directory.
  121. #####################################################################################
  122. # Abstract Target dependencies
  123. "{_FWTargetObjectsDir}{__ComponentName}.RSED" ƒ ∂
  124.             {__ComponentResources} {SafeTarget}
  125.  
  126. "{_FWTargetObjectsDir}{__ComponentName}.IDE.rsrc" ƒ ∂
  127.             {__ComponentResources} {SafeTarget}
  128.     #{_FWEcho} {_FWEchoOptions} "Consolidating: {__ComponentName}"
  129.     #Begin
  130.     #    for __resourceFile__ in {__FrameworkResources}
  131.     #        echo "include ∂"{__resourceFile__}∂" not ∂'ckid∂';"
  132.     #    end
  133.     #    for __resourceFile__ in {__ComponentResources}
  134.     #        echo "include ∂"{__resourceFile__}∂" not ∂'ckid∂';"
  135.     #    end
  136.     #End | {_FWRC} -t rsrc -c RSED -o "{_FWTargetObjectsDir}{__ComponentName}.IDE.rsrc"    
  137.  
  138. #####################################################################################
  139. # SOM build target
  140. # This an abstract target to get somc to update all the SOM-related files. It's meant
  141. # to be used by Rainbow.
  142. #
  143. # All som-dependent files in __ComponentSourcesFromIDL are updated by the SOM
  144. # compiler.
  145. #####################################################################################
  146.  
  147. "{_FWTargetObjectsDir}{__ComponentName}.SOM" ƒ ∂
  148.             {__ComponentSourcesFromIDL} {SafeTarget}
  149.  
  150. #####################################################################################
  151. # IDE build Target
  152. #
  153. # This is an abstract target for building resources and SOM-related files for 
  154. # the MetroWerks and Symantec IDEs (which will soon enough build their own rsrc files).
  155. #
  156. # The IDE target is <module>.IDE (abstract)
  157. #
  158. # All it does is invoke the .RSED and .SOM targets.
  159. #####################################################################################
  160. # Abstract Target dependencies
  161. "{_FWTargetObjectsDir}{__ComponentName}.IDE" ƒ ∂
  162.             "{_FWTargetObjectsDir}{__ComponentName}.SOM" ∂
  163.             "{_FWTargetObjectsDir}{__ComponentName}.RSED"
  164.  
  165. #####################################################################################
  166. # Inference Rules
  167. #####################################################################################
  168.  
  169. .a.o    ƒ    .a 
  170.     {_FWEcho} {_FWEchoOptions} "Assembling:     {default}.a"
  171.     {_FWAsm} ∂
  172.         {_FWAsmOptions} ∂
  173.         {__IncludeDirs} ∂
  174.         -o {targDir}{default}.a.o ∂
  175.         {depDir}{default}.a
  176.  
  177. .c.o    ƒ    .c 
  178.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.c"
  179.     {_FWC} ∂
  180.         {_FWCOptions} ∂
  181.         {__COptions} ∂
  182.         {__IncludeDirs} ∂
  183.         -o {targDir}{default}.c.o ∂
  184.         {depDir}{default}.c
  185.  
  186. .cp.o    ƒ    .cp
  187.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.cp"
  188.     {_FWCpp} ∂
  189.         {_FWCppOptions} ∂
  190.         {__CppOptions} ∂
  191.         {__CIncludeDirs} ∂
  192.         {__IncludeDirs} ∂
  193.         -o {targDir}{default}.cp.o ∂
  194.         {depDir}{default}.cp
  195.  
  196. .cpp.o    ƒ    .cpp
  197.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.cpp"
  198. #    We use a precompiled header file only if {__PrecompiledHeaderFile} is defined.
  199.     If {__PrecompiledHeaderFile}
  200.         {_FWCpp} ∂
  201.             {_FWCppOptions} ∂
  202.             {__CppOptions} ∂
  203.             {__IncludeDirs} ∂
  204.             {__CIncludeDirs} ∂
  205.             -load {__PrecompiledHeaderFile} ∂
  206.             -o {targDir}{default}.cpp.o ∂
  207. #             -export_list {targDir}{default}.x ∂
  208.             {depDir}{default}.cpp
  209. #        dumpxcoff -n all {targDir}{default}.cpp.o | StreamEdit -s "{FWToolsDir}"exportScript > {targDir}{default}.z
  210.     Else
  211.         {_FWCpp} ∂
  212.             {_FWCppOptions} ∂
  213.             {__CppOptions} ∂
  214.             {__IncludeDirs} ∂
  215.             {__CIncludeDirs} ∂
  216.             -o {targDir}{default}.cpp.o ∂
  217.             {depDir}{default}.cpp
  218.     End
  219.  
  220. # [HLX] for now we don't want to regenerate the .cpp file until Windows and Mac are stable
  221. .cpp ƒ .idl
  222. #    {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.idl --> {default}.cpp"
  223. #    somc ∂
  224. #        {__IDLIncludeDirs} ∂
  225. #        -m cpluscpp -p -e xc ∂
  226. #        -D __PRIVATE__ ∂
  227. #        -I "{ODF}Found:FWCommon:Include:" ∂
  228. #        -o {TargDir} ∂
  229. #        {depDir}{default}.idl
  230.     setfile -m . {Targ}
  231.  
  232. .xih ƒ .idl
  233.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.idl --> {default}.xih"
  234.     somc ∂
  235.         {__IDLIncludeDirs} ∂
  236.         -m cpluscpp -p -e xih ∂
  237.         -D __PRIVATE__ ∂
  238.         -I "{ODF}Found:FWCommon:Include:" ∂
  239.         -o {TargDir} ∂
  240.         {depDir}{default}.idl
  241.  
  242. .xh ƒ .idl
  243.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.idl --> {default}.xh"
  244.     somc ∂
  245.         {__IDLIncludeDirs} ∂
  246.         -m cpluscpp -e xh ∂
  247.         -D __PRIVATE__ ∂
  248.         -I "{ODF}Found:FWCommon:Include:" ∂
  249.         -o {TargDir} ∂
  250.         {depDir}{default}.idl
  251.  
  252. .rsrc    ƒ    .fr
  253.     {_FWEcho} {_FWEchoOptions} "ODFRC:            {default}.fr"
  254.     {_FWOPFRC} ∂
  255.         {_FWOPFRCOptions} ∂
  256.         {__FWRCIncludeDirs} ∂
  257.         -o {targDir}{default}.rsrc ∂
  258.         {depDir}{default}.fr
  259.  
  260. .rsrc    ƒ    .r
  261.     {_FWEcho} {_FWEchoOptions} "Rezzing:          {default}.r"
  262.     {_FWRC} ∂
  263.         {_FWRCOptions} ∂
  264.         {__FWRCIncludeDirs} ∂
  265.         {__IncludeDirs} ∂
  266.         -o {targDir}{default}.rsrc ∂
  267.         {depDir}{default}.r
  268.  
  269. #####################################################################################
  270. # Maintenance Targets
  271. #####################################################################################
  272.  
  273. "{_FWTargetObjectsDir}"CleanObj    ƒ
  274.     {_FWEcho} {_FWEchoOptions} "Deleting Object Files from:     {_FWTargetObjectsDir}"
  275.     delete -y -i {__ComponentObjects}
  276.  
  277. "{_FWTargetObjectsDir}"CleanRes    ƒ
  278.     {_FWEcho} {_FWEchoOptions} "Deleting Resources from :     {_FWTargetObjectsDir}"
  279.     delete -y -i {__ComponentResources}
  280.         
  281. "{_FWTargetObjectsDir}"CleanLib    ƒ
  282.     {_FWEcho} {_FWEchoOptions} "Deleting Libraries from :     {_FWLibDir}"
  283.     delete -y -i "{_FWLibDir}{__ComponentName}.o"
  284.     delete -y -i "{_FWLibDir}{__ComponentName}.rsrc"
  285.  
  286. "{_FWTargetObjectsDir}"CleanAll    ƒ ∂
  287.     "{_FWTargetObjectsDir}"CleanObjects ∂
  288.     "{_FWTargetObjectsDir}"CleanResources ∂
  289.     "{_FWTargetObjectsDir}"CleanLibs
  290.  
  291. "{_FWTargetObjectsDir}"KillDir    ƒ ∂
  292.     "{_FWTargetObjectsDir}"CleanLibs
  293.     {_FWEcho} {_FWEchoOptions} "Deleting Build Directory:     {_FWTargetObjectsDir}"
  294.     delete -y -i "{_FWTargetObjectsDir}"
  295.     
  296. #####################################################################################
  297. # CFM Static Linked Libraries
  298. #
  299. # A CFM library target is the same as the IDE target (som/idl and resources)
  300. # plus it will use the MPW Lib command to merge all the __ComponentObjects into one
  301. # static linked library for this layer.
  302. #
  303. # The shared library target is <module>.SLL (abstract)
  304. #
  305. #####################################################################################
  306. # Abstract Target dependencies
  307. "{_FWTargetObjectsDir}{__ComponentName}.SLL" ƒ ∂
  308.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  309.             "{_FWLibDir}{__ComponentName}.lib" ∂
  310.             {__OtherComponentDependencies}
  311.  
  312.  
  313. "{_FWLibDir}{__ComponentName}.lib" ƒ ∂
  314.             "{_FWTargetObjectsDir}{__ComponentName}.obj"
  315.     duplicate -y "{_FWTargetObjectsDir}{__ComponentName}.obj" {Targ}
  316.     
  317. "{_FWTargetObjectsDir}{__ComponentName}.obj" ƒ {__ComponentObjects} 
  318.     {_FWEcho} {_FWEchoOptions} "Libbing:     {_FWTargetObjectsDir}{__ComponentName}.obj"
  319.     {_FWLib} ∂
  320.         {__StaticLibraryLinkOptions} ∂
  321.         {__ComponentObjects} ∂
  322.         -o "{Targ}"
  323.  
  324. #####################################################################################
  325. # CFM Shared Libraries
  326. #
  327. # A shared library target is the same as the IDE target (som/idl and resources)
  328. # plus it will use the MPW-hosted compiler specified by the build suite to compile
  329. # the object files. This case will mainly be CFM-68K
  330. #
  331. # The shared library target is <module>.CFM (abstract)
  332. #
  333. # All __ComponentObjects are linked into a shared library in the objects folder.
  334. #
  335. # All som/idl and resource files are built as described in MacMake.rul for the IDE
  336. # target.
  337. #####################################################################################
  338. # Abstract Target dependencies
  339. "{_FWTargetObjectsDir}{__ComponentName}.CFM" ƒ ∂
  340.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  341.             "{_FWBinDir}{__ComponentName}" ∂
  342.             {__OtherComponentDependencies}
  343.  
  344. "{_FWBinDir}{__ComponentName}" ƒ ∂
  345.             "{_FWTargetObjectsDir}{__ComponentName}.pef"
  346.     duplicate -y "{_FWTargetObjectsDir}{__ComponentName}.pef" {Targ}
  347. #    if `Exists ":Bin:"`
  348. #        duplicate -y {Targ} ":Bin:{__ComponentName}"
  349. #    End
  350.     If  `Exists "{_FWTargetObjectsDir}{__ComponentName}.SYM"`
  351.         duplicate -y "{_FWTargetObjectsDir}{__ComponentName}.SYM" {Targ}.SYM
  352.     End
  353.     
  354. "{_FWTargetObjectsDir}{__ComponentName}Cache.rsrc" ƒ ∂
  355.             {__FrameworkResources} ∂
  356.             {__ComponentResources}
  357.     {_FWEcho} {_FWEchoOptions} "Consolidating: {__ComponentName}"
  358.     Begin
  359.         for __resourceFile__ in {__FrameworkResources}
  360.             echo  "include ∂"{__resourceFile__}∂";"
  361.         end
  362.         for __resourceFile__ in {__ComponentResources}
  363.             echo  "include ∂"{__resourceFile__}∂";"
  364.         end
  365.     End | {_FWRC} -a -o "{_FWTargetObjectsDir}{__ComponentName}Cache.rsrc"
  366.  
  367. "{_FWTargetObjectsDir}{__ComponentName}.seg" ƒ ∂
  368.             {__ComponentObjects} ∂
  369.             {__OpenDocObjects} ∂
  370.             {__FrameworkObjects} ∂
  371.             {__OtherObjects}
  372.         {_FWEcho} {_FWEchoOptions} "Linking:     {_FWTargetObjectsDir}{__ComponentName}"
  373.         If ¬ `Exists "{__ComponentName}.exp"`
  374.             {_FWEcho} {_FWEchoOptions}  "The {__ComponentName}.exp file is not in the current directory!"
  375.         End
  376.         {_FWLink} ∂
  377.             -l -map ∂
  378.             -mf -w ∂
  379.             {__SharedLibraryLinkOptions} ∂
  380.             -@export {__ComponentName}.exp ∂
  381.             -weaklib QuickDrawGXLib,QuickTimeLib ∂
  382.             -init {__CFMInitFunction} ∂
  383.             {__InitLibs} ∂
  384.             {__ComponentObjects} ∂
  385.             {__FrameworkObjects} ∂
  386.             {__OpenDocObjects} ∂
  387.             {__OtherObjects} ∂
  388.             {__SystemObjects} ∂
  389.             {__SystemLibEquates} ∂
  390.             -o {Targ} > {_FWTargetObjectsDir}{__ComponentName}.map
  391. #    If !{Status}
  392. #        ILinkToSym -sym 3.2 -mf {Targ}.NJ -o "{_FWTargetObjectsDir}{__ComponentName}".SYM 
  393. #    End
  394.  
  395. "{_FWTargetObjectsDir}{__ComponentName}.pef" ƒ ∂
  396.             "{_FWTargetObjectsDir}{__ComponentName}.seg" ∂
  397.             "{_FWTargetObjectsDir}{__ComponentName}Cache.rsrc"
  398.     MakeFlat "{_FWTargetObjectsDir}{__ComponentName}".seg -o {Targ}
  399.     {_FWEcho} {_FWEchoOptions} Copying Resources From: "{_FWTargetObjectsDir}{__ComponentName}Cache.rsrc"
  400.     Echo "include ∂"{_FWTargetObjectsDir}{__ComponentName}Cache.rsrc∂";" | Rez -a -o {Targ}
  401.     If {__ComponentSignature}
  402.         SetFile -c {__ComponentSignature} -a B -t 'shlb' -m . {Targ}
  403.     Else
  404.         {_FWEcho} {_FWEchoOptions} "Warning: __ComponentSignature not set; using default (cfmg)."
  405.         SetFile -c 'cfmg' -t 'shlb' -m . {Targ}
  406.     End
  407.